package view;


import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JTextArea;

import model.Model;


public class ViewPopupGrade extends JDialog{
	
	private static JLabel labelConsigne = new JLabel();
	private static JLabel labelBookTitle = new JLabel();
	private static JLabel labelBookAuthor = new JLabel();
	private static JLabel labelBookPublishedYear = new JLabel();
	private JTextArea textArea = new JTextArea();
	
	private Integer idCurrentBook;
    private Model m;
   
    private JOptionPane panneauDialogue;
    private View cadre;
    
    private Object[] lesObjets = {labelConsigne, labelBookTitle, labelBookAuthor, labelBookPublishedYear, textArea};
       
    
	
	public ViewPopupGrade(View fenetrePrincipale, Model m, Integer idCurrentBook) 
    {
	      super(fenetrePrincipale, "New Grade", false);

	      cadre = fenetrePrincipale;
	      
	      this.idCurrentBook = idCurrentBook;
	      this.m = m;
	     
	      
	      labelConsigne.setText("Enter your grade:");
	      labelBookTitle.setText("Title: " + m.getMapBooks().get(idCurrentBook).getTitle());
	      labelBookAuthor.setText("Author: " + m.getMapBooks().get(idCurrentBook).getAuthor());
	      labelBookPublishedYear.setText("Published year: " + m.getMapBooks().get(idCurrentBook).getPublishedYear().toString());
	      
	      panneauDialogue = new JOptionPane(lesObjets, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null);
	      
	      
	      setContentPane(panneauDialogue);
	      pack();
    }



	public static JLabel getLabelConsigne() {
		return labelConsigne;
	}



	public static void setLabelConsigne(JLabel labelConsigne) {
		ViewPopupGrade.labelConsigne = labelConsigne;
	}



	public static JLabel getLabelBookTitle() {
		return labelBookTitle;
	}



	public static void setLabelBookTitle(JLabel labelBookTitle) {
		ViewPopupGrade.labelBookTitle = labelBookTitle;
	}



	public static JLabel getLabelBookAuthor() {
		return labelBookAuthor;
	}



	public static void setLabelBookAuthor(JLabel labelBookAuthor) {
		ViewPopupGrade.labelBookAuthor = labelBookAuthor;
	}



	public static JLabel getLabelBookPublishedYear() {
		return labelBookPublishedYear;
	}



	public static void setLabelBookPublishedYear(JLabel labelBookPublishedYear) {
		ViewPopupGrade.labelBookPublishedYear = labelBookPublishedYear;
	}



	public JTextArea getTextArea() {
		return textArea;
	}



	public void setTextArea(JTextArea textArea) {
		this.textArea = textArea;
	}



	public Integer getIdCurrentBook() {
		return idCurrentBook;
	}



	public void setIdCurrentBook(Integer idCurrentBook) {
		this.idCurrentBook = idCurrentBook;
	}



	public Model getM() {
		return m;
	}



	public void setM(Model m) {
		this.m = m;
	}



	public JOptionPane getPanneauDialogue() {
		return panneauDialogue;
	}



	public void setPanneauDialogue(JOptionPane panneauDialogue) {
		this.panneauDialogue = panneauDialogue;
	}



	public View getCadre() {
		return cadre;
	}



	public void setCadre(View cadre) {
		this.cadre = cadre;
	}



	public Object[] getLesObjets() {
		return lesObjets;
	}



	public void setLesObjets(Object[] lesObjets) {
		
	}
	
	
	
}
